<?php
/**
 *  删除院校信息
 *  by HehongChen
 *  2014.10.22 
 */

// 系统配置文件
require_once(dirname(__FILE__)."/config.php");
if(empty($dopost)) $dopost = '';


if($dopost=="delete")
{
    $dsql->ExecuteNoneQuery("DELETE FROM `#@__collegeinfo` WHERE collegeId='$college_id'");
    $dsql->ExecuteNoneQuery("DELETE FROM `#@__collegeinfo_detail` WHERE collegeId='$college_id'");
    $dsql->ExecuteNoneQuery("DELETE FROM `#@__collegeinfo_professor` WHERE collegeId='$college_id'");
    $dsql->ExecuteNoneQuery("DELETE FROM `#@__collegeinfo_recruit` WHERE collegeId='$college_id'");
    $dsql->ExecuteNoneQuery("DELETE FROM `#@__collegeinfo_project` WHERE collegeId='$college_id'");
    $dsql->ExecuteNoneQuery("DELETE FROM `#@__collegeinfo_news` WHERE collegeId='$college_id'");
    ShowMsg("成功删除！",$ENV_GOBACK_URL);
    exit();
}
else if($dopost=="delall")
{
    $college_ids = explode(',',$college_ids);
    if(isset($college_ids) && is_array($college_ids))
    {
        foreach($college_ids as $college_id)
        {
            $dsql->ExecuteNoneQuery("DELETE FROM `#@__collegeinfo` WHERE collegeId='$college_id'");
            $dsql->ExecuteNoneQuery("DELETE FROM `#@__collegeinfo_detail` WHERE collegeId='$college_id'");
            $dsql->ExecuteNoneQuery("DELETE FROM `#@__collegeinfo_professor` WHERE collegeId='$college_id'");
            $dsql->ExecuteNoneQuery("DELETE FROM `#@__collegeinfo_recruit` WHERE collegeId='$college_id'");
            $dsql->ExecuteNoneQuery("DELETE FROM `#@__collegeinfo_project` WHERE collegeId='$college_id'");
            $dsql->ExecuteNoneQuery("DELETE FROM `#@__collegeinfo_news` WHERE collegeId='$college_id'");
        }
        ShowMsg("成功删除！",$ENV_GOBACK_URL);
        exit();
    }
    else
    {
        ShowMsg("你没选定任何条目！",$ENV_GOBACK_URL);
        exit();
    }
}